package com.data2wisdom.comm.base.model;

import java.io.Serializable;

import com.alibaba.druid.util.StringUtils;

import io.swagger.annotations.ApiModel;

/**
 * 分页查询参数通用DTO
 * @author LV
 *
 */
@ApiModel(value = "分页查询参数通用DTO")
public class PageQueryDto<T> implements Serializable{
	
	private static final long serialVersionUID = -2792028968202290118L;
	/**
	 * 页码
	 */
	private Integer pageIndex;
	/**
	 * 每页记录数
	 */
	private Integer pageSize;
	/**
	 * 排序字段
	 */
	private String sortField;
	/**
	 * 排序方式
	 */
	private String sortOrder;
	/**
	 * 搜索条件
	 */
	private String searchData;
	public Integer getPageIndex() {
		return pageIndex==null?0:pageIndex;
	}
	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}
	public Integer getPageSize() {
		return pageSize==null?10:pageSize;
	}
	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}
	public String getSortField() {
		if (StringUtils.isEmpty(this.sortField)) {
			return Constants.DEFAULT_SORT_FIELD;
		}
		return sortField;
	}
	public void setSortField(String sortField) {
		this.sortField = sortField;
	}
	public String getSortOrder() {
		if (StringUtils.isEmpty(this.sortOrder)) {
			return Constants.DEFAULT_SORT_ORDER;
		}
		return sortOrder;
	}
	public void setSortOrder(String sortOrder) {
		this.sortOrder = sortOrder;
	}
	public String getSearchData() {
		return searchData;
	}
	public void setSearchData(String searchData) {
		this.searchData = searchData;
	}
}
